package javaThread;

public class TestBlock implements Runnable {
	private static Object locker = new Object();

	@Override
	public void run() {
		try {
			// 等待主线程获取锁
			Thread.sleep(10000);

			// 请求locker对象的内部锁
			synchronized (locker) {
				System.out.println("Get locker");

			}
		} catch (InterruptedException e) {
			// TODO: handle exception
		}
	}

	public static void main(String[] args) {
		Thread t = new Thread(new TestBlock(), "Test");
		t.start();
		synchronized (locker) {
			while (true) {
				;
				;
			}
		}
	}
}
